Dynamic Dialog Box Titles

Description

It is possible to dynamically change the title of an Xdialog. First, we use indirection to title the dialog box "Fred".

title_var_name = "title_var" + stritran(time(), ":", "_")
eval(title_var_name) = "Fred"
dlg_title = "@=" + title_var_name
ui_modeless_dlg_box(dlg_title, "Hello {text=50,2}", "1=1")
images/XD_Dynamic_Titles_1.gif

Then we use the EVAL()and UI_MODELESS_DLG_REFRESH()functions to rename it.

eval(title_var_name) = "George"
ui_modeless_dlg_refresh("@=" + title_var_name)
images/XD_Dynamic_Titles_2.gif

You cannot close the dialog with either "Fred" or "George". You must use "@=" + title_var_name.

ui_modeless_dlg_close("@=" + title_var_name)

Limitations

Desktop applications only.

See Also